<template>
  <view>
    <u-navbar
      :title="type == 1 ? '支付成功' : '支付失败'"
      back-icon-size="34"
      title-size="36"
      :border-bottom="false"
      :background="background"
      title-color="#333"
      back-icon-color="#333"
    ></u-navbar>
    <view class="" style="text-align: center; padding-top: 45rpx">
      <image
        :src="type == 1 ? 'https://wenzhen.fuerle168.com/static/cc.png' : 'https://wenzhen.fuerle168.com/static/sb.png'"
        mode=""
        style="width: 550rpx; height: 330rpx"
      ></image>
    </view>
    <view class="" style="text-align: center; font-size: 32rpx">
      {{ type == 1 ? '支付成功' : '支付失败' }}
    </view>
    <view class="btn" @tap="goto">
      {{ type == 1 ? '查看订单' : '重新支付' }}
    </view>
  </view>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      background: {
        background: '#fff'
      },
      type: null,
      pio: null
    };
  },
  //方法
  methods: {
    goto() {
      if (this.type == 1) {
        if (this.pio) {
          console.log('111');
          uni.reLaunch({
            url: '/pages/user/user'
          });
        } else {
          console.log('2222');
          uni.reLaunch({
            url: '/pages/shop/shop'
          });
        }
      } else {
        uni.navigateBack();
      }
    }
  },
  //首页渲染
  onLoad(options) {
    this.type = options.type;
    if (options.pio) {
      this.pio = options.pio;
    }
  },
  //监听
  watch: {},
  //计算属性
  computed: {}
};
</script>

<style lang="scss" scoped>
page {
  background: #f8f8f8;
}

.btn {
  width: 200rpx;
  height: 66rpx;
  border: 1rpx solid #cccccc;
  border-radius: 33rpx;
  text-align: center;
  line-height: 66rpx;
  color: #999999;
  font-size: 26rpx;
  margin: 31rpx auto;
}
</style>
